package com.ruoyi.project.gzbook.accountinfo.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.gzbook.accountinfo.mapper.DgAccountInfoMapper;
import com.ruoyi.project.gzbook.accountinfo.domain.DgAccountInfo;
import com.ruoyi.project.gzbook.accountinfo.service.IDgAccountInfoService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 支付账户Service业务层处理
 * 
 * @author mhg
 * @date 2021-10-06
 */
@Service
public class DgAccountInfoServiceImpl implements IDgAccountInfoService 
{
    @Autowired
    private DgAccountInfoMapper dgAccountInfoMapper;

    /**
     * 查询支付账户
     * 
     * @param id 支付账户主键
     * @return 支付账户
     */
    @Override
    public DgAccountInfo selectDgAccountInfoById(Long id)
    {
        return dgAccountInfoMapper.selectDgAccountInfoById(id);
    }

    /**
     * 查询支付账户列表
     * 
     * @param dgAccountInfo 支付账户
     * @return 支付账户
     */
    @Override
    public List<DgAccountInfo> selectDgAccountInfoList(DgAccountInfo dgAccountInfo)
    {
        return dgAccountInfoMapper.selectDgAccountInfoList(dgAccountInfo);
    }

    /**
     * 新增支付账户
     * 
     * @param dgAccountInfo 支付账户
     * @return 结果
     */
    @Override
    public int insertDgAccountInfo(DgAccountInfo dgAccountInfo)
    {
        dgAccountInfo.setCreateTime(DateUtils.getNowDate());
        return dgAccountInfoMapper.insertDgAccountInfo(dgAccountInfo);
    }

    /**
     * 修改支付账户
     * 
     * @param dgAccountInfo 支付账户
     * @return 结果
     */
    @Override
    public int updateDgAccountInfo(DgAccountInfo dgAccountInfo)
    {
        return dgAccountInfoMapper.updateDgAccountInfo(dgAccountInfo);
    }

    /**
     * 批量删除支付账户
     * 
     * @param ids 需要删除的支付账户主键
     * @return 结果
     */
    @Override
    public int deleteDgAccountInfoByIds(String ids)
    {
        return dgAccountInfoMapper.deleteDgAccountInfoByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除支付账户信息
     * 
     * @param id 支付账户主键
     * @return 结果
     */
    @Override
    public int deleteDgAccountInfoById(Long id)
    {
        return dgAccountInfoMapper.deleteDgAccountInfoById(id);
    }
}
